<style scoped>
  @import "../css/page7.css"; /* 引入预定义变量 */
  .post-css-test{
    transform: rotateY(360deg);
    box-shadow: 0 0 3px 5px rgba(222, 222, 222, .3);
    display: flex;
    color: var(--color-main);
  }
</style>
<template>
  <div class="height100">
    <div class="home-page-center single-page-center base">
      <div class="home-section-wrap page-center-wrap-bottom">
        <div class="home-section-env">
          <h1>包络融合页面</h1>

   请设置算法权重：<br>
  <el-input placeholder="请设置权重：" v-model="weight1" class="input">
    <template slot="prepend">局部离群因子算法</template>
  </el-input>

  <br>

  <el-input placeholder="请设置权重：" v-model="weight2" class="input">
    <template slot="prepend">单分类支持向量机算法</template>
  </el-input>

  <br>

  <el-button @click="mix()">包络线融合</el-button>

  <br>
  <el-button type="button" v-on:click="decision">决策</el-button>
  异常产品编号：{{product_id}}
        <br>
        <img style="width:500px" :src="img" class="im">

        </div>
      </div>
    </div>
  </div>
</template>

<script>


  //import ApiUser from 'src/api/ApiUser'




  export default {

    data() {


      return {
      weight1: 0.0,
       weight2: 0.0,
        img : "",
        product_id:'',


      }
    },
    methods: {
      decision: function (){
        this.$axios.post('/api/decision', {



          })
         .then(res=>{//alert(res.data)

                this.product_id = res.data

                  })
              .then(function (response) {
             console.log(response);
              })
            .catch(function (error) {
              console.log(error);
              });



      },

        mix: function (){

         //传3个参数
         //alert(this.weight2)
         var y=Number(this.weight1)+Number(this.weight2)

         //y:this.weight1 + this.weight2
         //alert(y)
         //alert(y)

         if(y!=1.0)
         {
           alert("请设置权重,和为1")
         }
         else
         {

          this.p1=this.weight1
          this.p2=this.weight2


         this.$axios.post('/api/post_mix', {


          p1:this.p1,
          p2:this.p2,
          })
         .then(res=>{

                this.img = 'data:;base64,' + res.data

                  })
              .then(function (response) {
             console.log(response);
              })
            .catch(function (error) {
              console.log(error);
              });
          alert("您已成功提交！")
         }
       },

    go(){


    },
    save(){
      alert("保存成功")
    }
  }
  }

</script>
